from sqlalchemy import Column, Integer, ForeignKey, DateTime, String
from sqlalchemy.orm import relationship
from ..database  import Base

class InterviewSession(Base):
    __tablename__ = "interview_sessions"

    id = Column(Integer, primary_key=True, index=True)
    user_id = Column(Integer, ForeignKey("users.id", ondelete="CASCADE"))
    start_time = Column(DateTime, nullable=False)
    end_time = Column(DateTime)
    session_type = Column(String(50), default='ai_interview')
    report_path = Column(String(255))
    created_at = Column(DateTime)

    # ORM 关系（可选）
    # user = relationship("User", back_populates="sessions")
